package io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

public class Test3 {
    public static void main(String[] args) throws IOException {
        FileOutputStream fis=new FileOutputStream("note.txt",true);
        Scanner sc=new Scanner(System.in);
        while (true){
            String str=sc.nextLine();
            if("exit".equalsIgnoreCase(str)){
                break;
            }
            byte[] bytes=str.getBytes(StandardCharsets.UTF_8);
            fis.write(bytes);
        }
        fis.close();
        System.out.println("再见");
    }
}
